package gof.com.yew.singleton;

//懒汉式-可延迟加载 资源利用率提高
public class SingletonDemo02 {
	
	private static SingletonDemo02 instance;
	
	//构造器私有
	private SingletonDemo02() {	}
	
	//synchronized同步，执行效率低，并发效率降低
	public  static  synchronized SingletonDemo02 getInstance() {
		if(instance == null) {
			instance = new SingletonDemo02();
		}
		return instance;
	}

}
